#!/usr/bin/env python
# -*- coding:utf-8 -*-

import urllib2


def get_html(url):
    while True:
        try:
            headers = {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0'}
            req = urllib2.Request(url, headers=headers)
            resp = urllib2.urlopen(req, timeout=10)
            html = resp.read()
            return html
        except Exception as e:
            print str(e)
